Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node: add graphviz to container image #31

Merged
merged 4 commits into from
Sep 17, 2019

Conversation

grayside
Copy link
Contributor

@grayside grayside commented Sep 4, 2019

This is a step toward GoogleCloudPlatform/nodejs-docs-samples#1436.

An alternative to adding graphviz to the container is to pursue container-centric unit testing for Cloud Run on node.js as a follow-up to #16

apt-get install -y \
graphviz \
; \
rm -rf /var/lib/apt/lists/*
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to delete the package information?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is standard practice in Dockerfiles to clean up package information/caches related to packager tooling to create lean images. This is the standard approach recommended with apt-get.

Copy link
Contributor

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gather the samples repo runs on all Node targets? part of me wonders if we should have a specific node target that has all the dependencies needed by the samples repo, especially if we gradually add more over time.

Not a blocker if this helps get us over the finish line soon though; what are your thoughts @fhinkel?

@grayside
Copy link
Contributor Author

What do you mean by a "node target"? My reading is that you are suggesting a variant of the node images with anything specific to the samples repo?

If so, graphviz alone doesn't justify that. However, there are some shell scripts, one of which is used by every sample tested as a sort of container entrypoint.

]Test efficiency would be increased by moving some of the common or non-conflicting steps into the Dockerfile, such as the top-level npm install. The downside is that more of the testing process is moved into this repo, where there's not a CI process to anticipate problems.

Referenced Shell Scripts:

Copy link
Contributor

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

talked with @grayside in chat, for the first few additional dependencies like this, I see no problem with adding to the base container, if we find this is happening often, we might want a strategy that lets specific samples add additional dependencies to their build process as needed.

Copy link

@fhinkel fhinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants